<?php

namespace app\apishop\validate;
use think\Validate;

/**
 * 投诉表
 */
class ComplaintValidate extends  Validate
{
    protected $rule = [
        'image' => 'require',
        'user_shop_id' => 'require|dbExists:user_shop,id',
        'content' => 'require',
        'cases_type_id' => 'require|dbExists:cases_type,id',
    ];

    protected $message = [
        'image.require' => '投诉图片不能为空',
        'content.require' => '投诉原因不能为空',
        'cases_type_id.require' => '投诉类型不能为空',
        'cases_type_id.dbExists' => '投诉类型未找到',
        'user_shop_id.require' => '商家信息未找到',
        'user_shop_id.dbExists' => '商家信息未找到',
        'content.dbExists' => '投诉原因不能为空',
    ];

    protected $scene = [
        'submit' => ['image' , 'user_shop_id','content','cases_type_id'],
    ];
}